package com.zx.callback.common.handler;

import java.io.Serializable;

/**
 * 分页util
 * Created by yanst on 2016/6/29.
 */
public class PageUtil implements Serializable {

    /**
     * 获取总页数
     * @param total
     * @param pageSize
     * @return
     */
    public static int getTotalPage(int total, int pageSize){
        if(total == 0 || pageSize == 0){
            return 0;
        }
        int countPage = total/pageSize;
        if(total%pageSize > 0){
            countPage = countPage+1;
        }
        return countPage;
    }
}
